﻿@model bool
@*
    Use bool template for bool model.
    Because the default behavior will render a checkbox and a hidden input.
    But serializeObject funtion (checkwerWizard.js) will make this Property as an Array
    --> so that it can't be map with the associate property when post to controller
*@
<input type="checkbox" @(Model ? "checked=checked" : "") value="@Model"  name="@ViewData.TemplateInfo.HtmlFieldPrefix" id="@TagBuilder.CreateSanitizedId(ViewData.TemplateInfo.HtmlFieldPrefix)" />
<script language="javascript" type="text/javascript">
    $('#@TagBuilder.CreateSanitizedId(ViewData.TemplateInfo.HtmlFieldPrefix)').on('change', function () {
        $(this).val($(this).is(':checked'));
    });
</script>
